Page({

  data: {

  },

  onLoad: function (options) {
    //console.log(options.id)
    this.setData({
      mid: options.id
    })

    var that = this //中间变量，保存

  wx.request({
    url: 'https://liudongtushuguan.cn/v2/movie/subject/'+options.id,
    method:"GET", //默认get方法
    header:{
      "content-type":"json"
    },
    success:function(res){
      console.log(res)
      if(res.statusCode==200){
        that.setData({
        movie:res.data
      })
      wx.setNavigationBarTitle({
        title: res.data.rating.average+"分"+res.data.title,
      })
      wx.hideNavigationBarLoading()
      }
    },
    onShareAppMessage:function(){
      return{
        tilte:"向你推荐"+this.data.movie.title //定义转发，个性化，标题
      }
    },
    fail:function(){},

    complete:function(){}
    })

}


})